// EcoModeler - C# Edition :: Version 9.16 build 3301
using System;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using Eco.Services;
using Eco.ObjectRepresentation;
using Eco.ObjectImplementation;
using Eco.UmlRt;
using Eco.UmlCodeAttributes;
using Eco.Subscription;

namespace TTServer
{
	#region MM_ECO_Generated
	#region Attributes
	[UmlElement(Id="{beae3127-6997-473d-b013-efbb76bd3dec}")]
	#endregion

	#region Documentation
	//1 Mannschaft
	/// Leistungszahl des Spielers in der Halbrunde
	#endregion

	#endregion
	public class Mannschaft: object, ILoopBack
	{
		#region MM_ECO AutoGenerated ECO code

		protected IContent eco_Content;

		IObject IObjectProvider.AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public IObjectInstance AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public struct Eco_LoopbackIndices
		{
			public const int Eco_FirstMember = 0;
			public const int Eco_MemberCount = (Eco_FirstMember + 15);
			public const int Aufstellung_MemberIndex = Eco_FirstMember + 0;
			public const int Ersatzspieler_MemberIndex = Eco_FirstMember + 1;
			public const int Ersatzspieltag_MemberIndex = Eco_FirstMember + 2;
			public const int Ersatzspielzeit_MemberIndex = Eco_FirstMember + 3;
			public const int Heimspieltag_MemberIndex = Eco_FirstMember + 4;
			public const int Heimspielzeit_MemberIndex = Eco_FirstMember + 5;
			public const int Klasse_MemberIndex = Eco_FirstMember + 6;
			public const int KlassenZusammensetzung_MemberIndex = Eco_FirstMember + 7;
			public const int Meldebogen_MemberIndex = Eco_FirstMember + 8;
			public const int Nummer_MemberIndex = Eco_FirstMember + 9;
			public const int Pokalteilnahme_MemberIndex = Eco_FirstMember + 10;
			public const int Position_MemberIndex = Eco_FirstMember + 11;
			public const int Spiellokal_MemberIndex = Eco_FirstMember + 12;
			public const int StammSpieler_MemberIndex = Eco_FirstMember + 13;
			public const int Wunsch_MemberIndex = Eco_FirstMember + 14;
		}

		public virtual object get_MemberByIndex(int index)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		public virtual void set_MemberByIndex(int index, object value)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		protected void Initialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content == null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				this.eco_Content = factory.CreateContent(this);
				this.eco_Content.LoopbackValid();
			}
		}

		protected void Deinitialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content != null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				factory.CreateContentFailed(this.eco_Content, this);
				this.eco_Content = null;
			}
		}

		public TTServer.KlassenZusammensetzung KlassenZusammensetzung
		{
			get
			{
				return (TTServer.KlassenZusammensetzung) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.KlassenZusammensetzung_MemberIndex));
			}
		}
		#endregion

		#region MM_ECO Model owned attributes
		//Note: Do not remove any property within this region, nor change its signature

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Mannschaft.Eco_LoopbackIndices.Meldebogen_MemberIndex), Id="{b5d157da-dd1e-48eb-a572-56029e44356e}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.MeldebogenMannschaft), Index=0)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Meldebogen Meldebogen
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Meldebogen) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Meldebogen_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Meldebogen_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(Mannschaft.Eco_LoopbackIndices.Nummer_MemberIndex), Id="{18027513-5e5b-4aed-82bf-c642316ddd54}")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Nummer der Mannschaft
		/// Nummer der Mannschaft
		#endregion

		#endregion
		public int Nummer
		{
			get
			{
				#region MM_ECO_Generated
				return (int) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Nummer_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Nummer_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Mannschaft.Eco_LoopbackIndices.Ersatzspieler_MemberIndex), Id="{59a1acbc-68c5-4106-8a33-bc3504722887}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.Ersatzmannschaft), Index=0)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Meldebogenspieler> Ersatzspieler
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Meldebogenspieler>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Ersatzspieler_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(Mannschaft.Eco_LoopbackIndices.Pokalteilnahme_MemberIndex), Id="{06a0228f-19ec-47de-9371-c05e3a7577a2}")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Mannschaft nimmt am Pokal teil
		/// Mannschaft nimmt am Pokal teil
		#endregion

		#endregion
		public bool Pokalteilnahme
		{
			get
			{
				#region MM_ECO_Generated
				return (bool) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Pokalteilnahme_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Pokalteilnahme_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Mannschaft.Eco_LoopbackIndices.Position_MemberIndex), Id="{8dfae042-07af-4d2f-8e36-41028e413ae7}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.SperreFuerMannschaft), Index=0)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Position> Position
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Position>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Position_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Mannschaft.Eco_LoopbackIndices.StammSpieler_MemberIndex), Id="{07773dd7-baef-402b-812a-3bbd20f2c8d3}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.StammMannschaft), Index=0)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Position> StammSpieler
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Position>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.StammSpieler_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Mannschaft.Eco_LoopbackIndices.Klasse_MemberIndex), Id="{480003a3-dd87-4fa9-937e-92679c39e0a5}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.KlassenZusammensetzung), Index=0)]
		[UmlMetaAttribute("multiplicity", "0..1")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public TTServer.Klasse Klasse
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Klasse) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Klasse_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Klasse_MemberIndex, ((object)(value)));
				#endregion
			}
		}



		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(Mannschaft.Eco_LoopbackIndices.Ersatzspielzeit_MemberIndex), Id="{ff42dd42-c242-48fe-881a-ab9db0e0b81f}")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Zeit des Ersatzspieltags
		/// Zeit des Ersatzspieltags als Zeit des DateTimes
		#endregion

		#endregion
		public DateTime Ersatzspielzeit
		{
			get
			{
				#region MM_ECO_Generated
				return (DateTime) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Ersatzspielzeit_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Ersatzspielzeit_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(Mannschaft.Eco_LoopbackIndices.Heimspieltag_MemberIndex), Id="{bf18616c-1b64-421e-b121-6d520af978c4}")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Heimspieltag
		/// Heimspieltag
		/// 
		/// 0 - Montag
		/// .
		/// .
		/// .
		/// .
		/// 6 - Sonntag
		#endregion

		#endregion
		public int Heimspieltag
		{
			get
			{
				#region MM_ECO_Generated
				return (int) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Heimspieltag_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Heimspieltag_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(Mannschaft.Eco_LoopbackIndices.Heimspielzeit_MemberIndex), Id="{b2fcd52c-4133-4e1f-871b-fad2618bb4b1}")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Zeit des Heimspieltags
		/// Zeit des Heimspieltags als Zeit-Teil des DateTimes
		#endregion

		#endregion
		public DateTime Heimspielzeit
		{
			get
			{
				#region MM_ECO_Generated
				return (DateTime) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Heimspielzeit_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Heimspielzeit_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(Mannschaft.Eco_LoopbackIndices.Ersatzspieltag_MemberIndex), Id="{eca702d7-3c86-4b95-ac2a-4d3181246046}")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Ersatzspieltag
		/// Ersatzspieltag
		/// 
		/// 0 - Montag
		/// .
		/// .
		/// .
		/// .
		/// 6 - Sonntag
		#endregion

		#endregion
		public int Ersatzspieltag
		{
			get
			{
				#region MM_ECO_Generated
				return (int) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Ersatzspieltag_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Ersatzspieltag_MemberIndex, ((object)(value)));
				#endregion
			}
		}


		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Mannschaft.Eco_LoopbackIndices.Aufstellung_MemberIndex), Id="{23766faa-52b6-49db-92e3-5035b13f6f65}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.AufstellungMannschaft), Index=0)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public TTServer.Aufstellung Aufstellung
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Aufstellung) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Aufstellung_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Aufstellung_MemberIndex, ((object)(value)));
				#endregion
			}
		}



		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Mannschaft.Eco_LoopbackIndices.Spiellokal_MemberIndex), Id="{ba1c6fe0-36ff-47bb-8dcf-448b180a54c5}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.MannschaftHalle), Index=1)]
		[UmlMetaAttribute("multiplicity", "0..1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Halle Spiellokal
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Halle) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Spiellokal_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Spiellokal_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Mannschaft.Eco_LoopbackIndices.Wunsch_MemberIndex), Id="{0c785659-b4c2-4a5f-ba7f-392ae0be50c0}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.WunschMannschaft), Index=0)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Wunsch> Wunsch
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Wunsch>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Wunsch_MemberIndex)));
				#endregion
			}
		}
		#endregion

		#region MM_ECO Model owned methods
		//Note: Do not remove any method within this region, nor change its signature

		public Mannschaft(IContent content)
		{
			#region MM_ECO_Generated
			this.eco_Content = content;
			content.AssertLoopbackUnassigned();
			#endregion
		}

		public Mannschaft(IEcoServiceProvider serviceProvider)
		{
			this.Initialize(serviceProvider);
			try
			{
				// Place user code ONLY here
			}
			catch (System.Exception)
			{
				this.Deinitialize(serviceProvider);
				throw;
			}
		}
		#endregion
	}
}
